import chardet


def get_encoding(context):
    code = chardet.detect(context)
    if code["confidence"] > 0.5:
        code = code["encoding"]
    else:
        code = ""
    return code
